package com.hong.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hong.dto.QueryClassesDTO;
import org.springframework.stereotype.Service;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import com.hong.domain.Classes;
import com.hong.dao.ClassesMapper;
import com.hong.service.ClassesService;
@Service
public class ClassesServiceImpl extends ServiceImpl<ClassesMapper,Classes> implements ClassesService {

    @Autowired
    private ClassesMapper classesMapper;

    @Override
    public Page<Classes> getPage(QueryClassesDTO param) {

        Page<Classes> page = new Page<>();
        page.setCurrent(param.getPageNum());
        page.setSize(param.getPageSize());
        Page<Classes> classesPage = classesMapper.selectPage(page, null);
        return classesPage;
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return classesMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Classes record) {
        return classesMapper.insert(record);
    }

    @Override
    public boolean insertOrUpdate(Classes record) {
        return classesMapper.insertOrUpdate(record);
    }

    @Override
    public int insertOrUpdateSelective(Classes record) {
        return classesMapper.insertOrUpdateSelective(record);
    }

    @Override
    public int insertSelective(Classes record) {
        return classesMapper.insertSelective(record);
    }

    @Override
    public Classes selectByPrimaryKey(Integer id) {
        return classesMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Classes record) {
        return classesMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Classes record) {
        return classesMapper.updateByPrimaryKey(record);
    }

    @Override
    public int updateBatch(List<Classes> list) {
        return classesMapper.updateBatch(list);
    }

}
